package com.pearadmin.system.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pearadmin.system.mapper.ReportAssessmentRationalityMapper;
import com.pearadmin.system.domain.ReportAssessmentRationality;
import com.pearadmin.system.service.IReportAssessmentRationalityService;

/**
 * 考核合理性审核Service业务层处理
 * 
 * @author jmys
 * @date 2021-04-12
 */
@Service
public class ReportAssessmentRationalityServiceImpl implements IReportAssessmentRationalityService 
{
    @Autowired
    private ReportAssessmentRationalityMapper reportAssessmentRationalityMapper;

    /**
     * 查询考核合理性审核
     * 
     * @param id 考核合理性审核ID
     * @return 考核合理性审核
     */
    @Override
    public ReportAssessmentRationality selectReportAssessmentRationalityById(Long id)
    {
        return reportAssessmentRationalityMapper.selectReportAssessmentRationalityById(id);
    }

    /**
     * 查询考核合理性审核列表
     * 
     * @param reportAssessmentRationality 考核合理性审核
     * @return 考核合理性审核
     */
    @Override
    public List<ReportAssessmentRationality> selectReportAssessmentRationalityList(ReportAssessmentRationality reportAssessmentRationality)
    {
        return reportAssessmentRationalityMapper.selectReportAssessmentRationalityList(reportAssessmentRationality);
    }

    /**
     * 查询考核合理性审核
     * @param reportAssessmentRationality 考核合理性审核
     * @param pageDomain
     * @return 考核合理性审核 分页集合
     * */
    @Override
    public PageInfo<ReportAssessmentRationality> selectReportAssessmentRationalityPage(ReportAssessmentRationality reportAssessmentRationality, PageDomain pageDomain)
    {
        PageHelper.startPage(pageDomain.getPage(),pageDomain.getLimit());
        List<ReportAssessmentRationality> data = reportAssessmentRationalityMapper.selectReportAssessmentRationalityList(reportAssessmentRationality);
        return new PageInfo<>(data);
    }

    /**
     * 新增考核合理性审核
     * 
     * @param reportAssessmentRationality 考核合理性审核
     * @return 结果
     */

    @Override
    public int insertReportAssessmentRationality(ReportAssessmentRationality reportAssessmentRationality)
    {
        return reportAssessmentRationalityMapper.insertReportAssessmentRationality(reportAssessmentRationality);
    }

    /**
     * 修改考核合理性审核
     * 
     * @param reportAssessmentRationality 考核合理性审核
     * @return 结果
     */
    @Override
    public int updateReportAssessmentRationality(ReportAssessmentRationality reportAssessmentRationality)
    {
        return reportAssessmentRationalityMapper.updateReportAssessmentRationality(reportAssessmentRationality);
    }

    /**
     * 删除考核合理性审核对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteReportAssessmentRationalityByIds(String[] ids)
    {
        return reportAssessmentRationalityMapper.deleteReportAssessmentRationalityByIds(ids);
    }

    /**
     * 删除考核合理性审核信息
     * 
     * @param id 考核合理性审核ID
     * @return 结果
     */
    @Override
    public int deleteReportAssessmentRationalityById(Long id)
    {
        return reportAssessmentRationalityMapper.deleteReportAssessmentRationalityById(id);
    }
}
